#!/usr/bin/env bash
NODE="${1:-$(hostname)}"
SEQ=$(date -u +%Y%m%d%H%M)
HB=$(curl -fsS -H 'Cache-Control: no-store' "http://8.138.171.9:8080/heartbeat?cb=${SEQ}")
TS=$(echo "$HB" | jq -r '.heartbeat.timestamp // .timestamp')
echo "{"node":"$NODE","recv_ts":"$TS","seq":"$SEQ","skew_ms":0,"status":"ACK"}"
